package com.example.idachuappone.index.welcomentity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class Welcome implements Serializable {
    private Awards awards;
    private List<Events> events;
    private List<PersonExpands> expands;
    private First first;
    private String flash;
    private List<Hot> hot;
    private List<Packages> packages;
    private ShareContent share;
    private List<Tags> tags;
    private List<Top> top;
    private Version version;

    public void parseJson(JSONObject json) {
        if (json != null) {
            JSONArray jsonArray;
            int i;
            JSONObject jsonObject1;
            if (json.has("top")) {
                jsonArray = json.optJSONArray("top");
                this.top = new ArrayList();
                for (i = 0; i < jsonArray.length(); i++) {
                    try {
                        jsonObject1 = jsonArray.getJSONObject(i);
                        this.top.add(new Top().parseJson(jsonObject1));
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
            if (json.has("events")) {
                jsonArray = json.optJSONArray("events");
                this.events = new ArrayList();
                for (i = 0; i < jsonArray.length(); i++) {
                    try {
                        jsonObject1 = jsonArray.getJSONObject(i);
                        this.events.add(new Events().parseJson(jsonObject1));
                    } catch (JSONException e2) {
                        e2.printStackTrace();
                    }
                }
            }
            this.flash = json.optString("flash");
            if (json.has("expands")) {
                this.expands = new ArrayList();
                JSONArray jsonArray2 = json.optJSONArray("expands");
                for (i = 0; i < jsonArray2.length(); i++) {
                    try {
                        jsonObject1 = jsonArray2.getJSONObject(i);
                        PersonExpands bb = new PersonExpands();
                        bb.parseJson(jsonObject1);
                        this.expands.add(bb);
                    } catch (JSONException e22) {
                        e22.printStackTrace();
                    }
                }
            }
            if (json.has("first")) {
                this.first = new First().parseJson(json.optJSONObject("first"));
            }
            if (json.has("tags")) {
                this.tags = new ArrayList();
                jsonArray = json.optJSONArray("tags");
                for (i = 0; i < jsonArray.length(); i++) {
                    try {
                        jsonObject1 = jsonArray.getJSONObject(i);
                        this.tags.add(new Tags().parseJson(jsonObject1));
                    } catch (JSONException e222) {
                        e222.printStackTrace();
                    }
                }
            }
            if (json.has("hot")) {
                this.hot = new ArrayList();
                jsonArray = json.optJSONArray("hot");
                for (i = 0; i < jsonArray.length(); i++) {
                    try {
                        jsonObject1 = jsonArray.getJSONObject(i);
                        this.hot.add(new Hot().parseJson(jsonObject1));
                    } catch (JSONException e2222) {
                        e2222.printStackTrace();
                    }
                }
            }
            if (json.has("version")) {
                this.version = new Version();
                this.version.parseJson(json.optJSONObject("version"));
            }
            if (json.has("share")) {
                this.share = new ShareContent().parseJson(json.optJSONObject("share"));
            }
            if (json.has("packages")) {
                jsonArray = json.optJSONArray("packages");
                this.packages = new ArrayList();
                for (i = 0; i < jsonArray.length(); i++) {
                    try {
                        jsonObject1 = jsonArray.getJSONObject(i);
                        this.packages.add(new Packages().parseJson(jsonObject1));
                    } catch (JSONException e22222) {
                        e22222.printStackTrace();
                    }
                }
            }
            if (json.has("awards")) {
                this.awards = new Awards();
                this.awards.parseJson(json.optJSONObject("awards"));
            }
        }
    }

    public List<Events> getEvents() {
        return this.events;
    }

    public void setEvents(List<Events> events) {
        this.events = events;
    }

    public List<PersonExpands> getExpands() {
        return this.expands;
    }

    public void setExpands(List<PersonExpands> expands) {
        this.expands = expands;
    }

    public List<Tags> getTags() {
        return this.tags;
    }

    public void setTags(List<Tags> tags) {
        this.tags = tags;
    }

    public List<Hot> getHot() {
        return this.hot;
    }

    public void setHot(List<Hot> hot) {
        this.hot = hot;
    }

    public Version getVersion() {
        return this.version;
    }

    public void setVersion(Version version) {
        this.version = version;
    }

    public ShareContent getShare() {
        return this.share;
    }

    public void setShare(ShareContent share) {
        this.share = share;
    }

    public List<Packages> getPackages() {
        return this.packages;
    }

    public void setPackages(List<Packages> packages) {
        this.packages = packages;
    }

    public First getFirst() {
        return this.first;
    }

    public void setFirst(First first) {
        this.first = first;
    }

    public List<Top> getTop() {
        return this.top;
    }

    public void setTop(List<Top> top) {
        this.top = top;
    }

    public String getFlash() {
        return this.flash;
    }

    public void setFlash(String flash) {
        this.flash = flash;
    }

    public Awards getAwards() {
        return this.awards;
    }

    public void setAwards(Awards awards) {
        this.awards = awards;
    }
}
